package homework_03;

import java.util.Scanner;

public class Work15 {
    public static void main(String[] args) {
        //编写一个程序，求整数n的阶乘，例如5的阶乘是1*2*3*4*5。
        Scanner sc = new Scanner(System.in);
        int sr = sc.nextInt();
        int i = 1;
        int sum = 1;
        StringBuffer sdf = new StringBuffer();
        sdf.append(sr+"的阶乘为");
        while( i <= sr ){
            sum *= i;
            if( i != 3 ){
                sdf.append(i+" * ");
            }else{
                sdf.append(i);
            }
            i++;
        }
        sdf.append(" = "+sum);
        System.out.println(sdf.toString());
    }
}
